package cn.ghb.demo.common.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * @author HongbinGao
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class CrudEntity {

    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Integer id;

    /**
     * 插入人，对应{@code user_info.id}
     */
    @TableField(value = "insert_by")
    private Integer insertBy;

    /**
     * 插入时间
     */
    @TableField(value = "insert_time")
    private LocalDateTime insertTime;

    /**
     * 更新人，对应{@code user_info.id}
     */
    @TableField(value = "update_by")
    private Integer updateBy;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    private LocalDateTime updateTime;

    /**
     * 删除标识 true 删除 false 未删除
     */
    @TableField(value = "is_deleted")
    @TableLogic(value = "false", delval = "true")
    private Boolean deleted;

}
